//
//  DAUModel.h
//  DAU-iOS
//
//  Created by XiangDongMBP on 2016/11/19.
//  Copyright © 2016年 East. All rights reserved.
//

#import <Foundation/Foundation.h>

#pragma mark - 机房列表
@interface DAUEngineRoomItem : NSObject<YYModel>
@property (nonatomic, assign) NSInteger collectorId;    //!< @"id"----采集器id
@property (nonatomic, copy)   NSString *name;           //!< 名字
@property (nonatomic, assign) BOOL state;               //!< 状态，0-正常 1-异常
@end

@interface DAUEngineRoomModel : NSObject<YYModel>
@property (nonatomic, assign) NSInteger errCode;        //!< 错误码
@property (nonatomic, copy)   NSString *msg;            //!< 错误描述
@property (nonatomic, strong) NSMutableArray<DAUEngineRoomItem *> *result;

- (void)addMoreWithData:(DAUEngineRoomModel *)data;
@end

#pragma mark - 具体机房采集器信息
extern CGFloat const DAUModelContactValueBaseMul;   // 服务器传过来的温度值默认放大了10倍

@interface DAUColContactItem : NSObject
@property (nonatomic, assign) NSInteger contactId;
@property (nonatomic, copy)   NSString *name;
@property (nonatomic, assign) NSInteger value;      //!< 干接点时(1-闭合 0-断开); 温度值
@property (nonatomic, assign) NSInteger state;      //!< 0-断开(出现故障)，1-有效
@end

@interface DAUColPowerModel : NSObject
@property (nonatomic, copy)   NSString *pic;        //Base64图片
@property (nonatomic, assign) NSInteger value;
@end

@interface DAUCollectorInfoModel : NSObject
@property (nonatomic, assign) NSInteger collectorId;    //!< @"id"----采集器id
@property (nonatomic, copy)   NSString *name;           //!< 名字
@property (nonatomic, assign) BOOL state;               //!< 状态，0-正常 1-异常
@property (nonatomic, assign) NSInteger tempUpper;      //!< 温度警戒线上限
@property (nonatomic, assign) NSInteger tempLower;      //!< 温度警戒线下限
@property (nonatomic, strong) NSArray<DAUColContactItem *> *temperature;        //!< 温湿度
@property (nonatomic, strong) NSArray<DAUColContactItem *> *contact;            //!< 干接点(报警)
@property (nonatomic, strong) NSArray<DAUColContactItem *> *control_contact;    //!< 控制接点
@property (nonatomic, strong) DAUColPowerModel *power_consumpsion;              //!< 电量

- (NSMutableArray<NSNumber *> *)controlContactRequestArray;    //!< 干接点控制请求服务器时的数组

@end

@interface DAUEngineDetailModel : NSObject
@property (nonatomic, assign) NSInteger errCode;                //!< 错误码
@property (nonatomic, copy)   NSString *msg;                    //!< 错误描述
@property (nonatomic, strong) DAUCollectorInfoModel *result;    //!< 具体机房采集器的所有信息
@end

#pragma mark - 总的数据模型
@interface DAUModel : NSObject
@property (nonatomic, strong) DAUEngineRoomModel *engineRoom;       //!< 机房的数据模型
@property (nonatomic, strong) DAUEngineRoomModel *engineSeaResult;  //!< 机房的搜索结果
@property (nonatomic, strong) DAUEngineDetailModel *engineDetail;   //!< 具体机房采集器的信息
@end
